package com.server.http.handler.impl;

import java.util.ArrayList;
import java.util.List;

import com.server.background.data.RankData;
import com.server.conditionenum.HttpReturnStatus;
import com.server.http.handler.HttpHandler;
import com.server.http.request.HttpRequestMessage;
import com.server.http.response.HttpResponseMessage;
import com.server.mine.net.HttpProtocol;
import com.server.tools.AppData;

/**
* @author	李小布
* @email	397554852@qq.com
* @version	创建时间：2018年9月29日 下午5:36:59
*/
public class GetRanklist extends HttpHandler{

	@Override
	public void handle(HttpRequestMessage request, HttpResponseMessage response) {
		String failMsg = null;
		List<RankData> list = new ArrayList<RankData>();
		String rkname = request.getParameter("rkname");
		try {
			list = AppData.ClientGetRankList(rkname);
		} catch (Exception e) {
			failMsg = "上传参数错误";
		}
		if(failMsg == null) {
			SetReturnData(response,list,HttpProtocol.GETRANKLIST,HttpReturnStatus.Successed);	
		}else {
			SetReturnData(response,new ArrayList<RankData>(),HttpProtocol.GETRANKLIST,HttpReturnStatus.Failed);
		}
		
	}
}